package com.base.cn.platform.os.service.manage.join;

import com.base.cn.platform.os.service.FeignAuthConfig;
import com.base.cn.platform.os.service.manage.BaseService;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * 角色与资源权限的关联Service
 *
 * @author s.li
 * @create 2018-03-06 11:44
 */
@FeignClient(name = BaseService.appName,configuration = FeignAuthConfig.class)
public interface RoleFunctionService extends BaseService {

    /**
     * 获取角色与权限的关联的数据列表
     * @param roleId 角色ID
     * @return List<RoleFunction>
     */
    @RequestMapping(contextPath+"/findRoleFunctionList")
    List<Map<String,Object>> findRoleFunctionList(@RequestParam("roleId") BigDecimal roleId);

    /**
     * 保存角色授权数据
     * @param roleId 角色ID
     * @param functionIds 权限ID组
     * @return Map<String,Object>
     */
    @RequestMapping(contextPath+"/saveRoleFunctionSubject")
    Map<String,Object> saveRoleFunctionSubject(@RequestParam("roleId") BigDecimal roleId,
                                               @RequestParam(value = "functionIds", required = false) String functionIds);
}
